package com.ftg.learn.day05;

/**
 * 计数器
 * 表示对循环进行记录的
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/11 下午4:09
 */
public class Flow02 {

    public static void main(String[] args) {

        /**
         * 计数器
         */
        int num = 0;
        for (int i = 1; i <= 100; i++) {
            num += (i % 2 == 0 ? 1 : 0);
        }
        System.out.println(num);

        int n = 0;
        for(int i = 2;i<=100;i+=2){
            n++;
        }
        System.out.println(n);

        boolean n1 = false;
        for (int i = 0; i < 100; i++) {
            if(i % 7 == 0){
                n1 = true;
                break;
            }
        }
        System.out.println(n1?"有":"无");
    }

}
